#include<iostream>
#include<unistd.h>
using namespace std;
 

//新线程
void *threadStart(void*args)
{
    cout<<"new thread runing   pid:"<<getpid()<<endl;
    sleep(1);
}
int main()
{
    pthread_t tid;
    pthread_create(&tid,nullptr,threadStart,(void*)"thread_new");
    //主线程
    while(true)
    {
        sleep(1);
        cout<<"main thread runing pid:"<<getpid()<<endl;
    }
    return 0;
}